package cn.itcast.nems.studentrecord.dao.mapper;

import cn.itcast.nems.studentrecord.dao.dataobject.JournalRenewalLineDiscountDO;
import cn.itcast.nems.studentrecord.dao.entity.JournalRenewalLineDiscount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface JournalRenewalLineDiscountMapper extends BaseMapper<JournalRenewalLineDiscount> {

    /**
     * 根据升级凭单ID和学籍查询优惠项
     * @param renewalId 升级凭单ID
     * @param recordId 学籍ID
     * @return 优惠项
     */
    List<JournalRenewalLineDiscountDO> findDiscountsByRenewalIdAndRecordId(@Param("renewalId") String renewalId,@Param("recordId") String recordId ) ;

    /**
     * 根据凭单ID和行ID查询优惠项
     * @param renewalId 升级凭单低
     * @param lineId 行ID
     * @return 凭单行优惠项列表
     */
    List<JournalRenewalLineDiscountDO> findDiscountsByRenewalIdAndLineId (@Param("renewalId") String renewalId,@Param("lineId") String lineId ) ;

    /**
     * <p>
     * 根据凭单ID和范围类型查询行优惠
     * </p>
     *
     * @param renewalId 凭单ID
     * @param discountScopeType 范围类型
     * @author zhouwei
     * @since 2023/12/15 3:18 PM
     **/
    List<JournalRenewalLineDiscountDO> findDiscountsByRenewalId(@Param("renewalId") String renewalId, @Param("discountScopeType") String discountScopeType ) ;
}
